<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}</title>
<meta name="keywords" content="{$SEO['keyword']}">
<meta name="description" content="{$SEO['description']}">
<link rel="stylesheet" type="text/css" href="{CSS_PATH}zouzou/css/defalut.css">
<link rel="stylesheet" type="text/css" href="{CSS_PATH}zouzou/css/base.css">
<link rel="stylesheet" type="text/css" href="{CSS_PATH}zouzou/css/content.css">
<script type="text/javascript" src="{JS_PATH}jquery.min.js"></script>
<script type="text/javascript" src="{JS_PATH}jquery.sgallery.js"></script>
<script type="text/javascript" src="{CSS_PATH}zouzou/js/base.js"></script>
</head>
<body onload="iframe_height()" style="background:none;">
{pc:comment action="get_comment" commentid="$commentid"}
{php $comment = $data;}
{/pc}
<div id="bodyheight">
<div class="reply_box">
  <div class="reply">
			<p>{if $comment[total]}{$comment[total]}{else}0{/if}条回复</p>
			<ul>
			{pc:comment action="lists" commentid="$commentid" siteid="$siteid" page="$_GET[page]" hot="$hot" num="20"}
			{if !empty($data)}      
			{loop $data $r}
				{php $memberinfoimg1=get_memberavatar($r['userid']);}
				<li>
					<div class="reply_li">
					<div class="pic">
					<a href="{member_url($r['username'])}" target="_blank"><Img src="{$memberinfoimg1}" alt="{$r['username']}" onerror="this.src='<?php echo CSS_PATH?>zouzou/images/img_05.jpg'" /></a>
					<p>{get_member_dj($r['username'])}</p>
					</div>						
					<div class="text">
						<h1><a href="#">{if $r[userid]}{get_nickname($r[userid])}{else}{$r[username]}{/if}</a>   {format::date($r[creat_at], 1)}</h1>
						<div class="contenth">{$r[content]}
							<div class="span"><a href="javascript:void(0)" onclick="reply({$r[id]}, '{$commentid}')">回复</a>  <a href="javascript:void(0)" onclick="support({$r[id]}, '{$commentid}')">支持（<font id="support_{$r[id]}">{$r[support]}</font>）</a></div>
						</div>
					</div>
					<div id="reply_{$r[id]}" style="display:none"></div>
					</div>
				</li>
			  {/loop}
			   {/if}
 			{/pc}	
			</ul>
 {if $pages}<div id="pages" class="text-r">{$pages}</div>{/if}
 </div>
<form action="{APP_PATH}index.php?m=comment&c=index&a=post&commentid={$commentid}" method="post" onsubmit="return on_submit()">
<input type="hidden" name="title" value="{urlencode(($comment[title] ? $comment[title] : $title))}">
<input type="hidden" name="url" value="{urlencode(($comment[url] ? $comment[url] : $url))}">
<input type="hidden" name="id" id="cid" value="">
      <div class="message">
	  	<div class="pic"><img src="{$memberinfoimg1}"  align="top" height="40" width="40" onerror="this.src='<?php echo CSS_PATH?>zouzou/images/22.png'" /></div>
        <div class="text"><textarea rows="8" cols="80" name="content" id="content"></textarea><br /><br />
        <input type="submit" value="发表评论" class="submit" /><span>{if $userid}{get_nickname()} <a href="{APP_PATH}index.php?m=member&c=index&a=logout&forward={urlencode(($comment[url] ? $comment[url] : $url))}"  target="_top">退出</a>{else}<a href="{APP_PATH}index.php?m=member&c=index&a=login&forward={urlencode(($comment[url] ? $comment[url] : $url))}" target="_top" class="blue">登录</a><span> | </span><a href="{APP_PATH}index.php?m=member&c=index&a=register" class="blue"  target="_top">注册</a> {if !$setting[guest]}<span style="color:red">需要登陆才可发布评论</span>{/if}{/if}</span>
		</div>
      </div>  
</form>
</div> 
<script type="text/javascript">
function support(id, commentid) {
	$.getJSON('{APP_PATH}index.php?m=comment&c=index&a=support&format=jsonp&commentid='+commentid+'&id='+id+'&callback=?', function(data){
		if(data.status == 1) {
			$('#support_'+id).html(parseInt($('#support_'+id).html())+1);
		} else {
			alert(data.msg);
		}
	});
}

function reply(id,commentid) {
	
	$('#cid').val(id);
	$('#content').focus();
}

function hide_code() {
	if ($('#yzmText').data('hide')==0) {
		$('#yzm').hide();
	}
}
function on_submit() {
	{if $setting[code]}
		var checkcode = $("#yzmText").val() == '' ? $("#yzmreplay").val() : $("#yzmText").val();
		var res = $.ajax({
			url: "{APP_PATH}index.php?m=pay&c=deposit&a=public_checkcode&code="+checkcode,
			async: false
		}).responseText;
	{else}
		var res = 1;
	{/if}
	if(res != 1) {
		alert('验证码错误');
		return false;
	} else {
		iframe_height(200);
		$('#bodyheight').hide();
		$('#loading').show();
		return true;
	}
}
function iframe_height(height) {
	if (!height) {
		var height = document.getElementById('bodyheight').scrollHeight;
	}
	$('#top_src').attr('src', "{$domain}js.html?"+height+'|'+{if $comment['total']}{$comment['total']}{else}0{/if});
}



</script>
</div>
<iframe width='0' id='top_src' height='0' src=''></iframe>
<div class="hidden text-c" id="loading">
<img src="{IMG_PATH}msg_img/loading.gif" /> 正在提交中...
</div>
</body>
</html>